home *** CD-ROM | disk | FTP | other *** search
/ Mesolore / Mesolore - Disc 1.iso / mac / data / Buttons.cst / 00274_Script_dispatcher < prev    next >
Text File  |  2001-04-13  |  6KB  |  206 lines

  1. Global gRetraceList,gwhichCD,gTargetMovie, gTargetFrame, gHtmlPath, gwinCDLetter, ginstallPath, gFullInstall
  2.  
  3. on New me
  4.   
  5.   
  6.   if the runmode = "sauthor" then
  7.     if the platform contains "Macintosh" then
  8.       gInstallPath =  "macintosh hd:mesolore:"
  9.     else
  10.       gInstallPath =  "c:windows\desktop\mesolore\"
  11.       gwincdletter = "e:"
  12.     end if
  13.   else
  14.     if me.checkForFullInstall() then
  15.       gFullInstall = TRUE
  16.     end if
  17.     if the platform contains "Macintosh" then
  18.       gInstallPath = the moviePath
  19.       --      alert gInstallpath
  20.     else
  21.       gwinCDLetter = me.findWinCD("cdinit.txt")
  22.       gInstallPath = the moviePath
  23.     end if
  24.   end if
  25.   if the platform contains "Macintosh" then
  26.     set the searchPaths = [the moviepath,"mesolore1:data:video","mesolore1:mesolore1:data:video"] --- new!!
  27.   else
  28.     set the searchPaths = [the moviepath,gwinCDLetter & "\data\video",gwinCDLetter & "\mesolore1\data\video"]--- new!!
  29.   end if
  30.   return me
  31. end
  32.  
  33. on goto me, whichFrame, whichmovie
  34.   if whichmovie contains "." then
  35.     set whichMovie = char 1 to (offset(".", whichmovie)-1)  of whichmovie
  36.   end if
  37.   if value(whichFrame) <> void then set whichFrame = value(whichFrame)
  38.   --alert string( "wf= " & whichframe & "wm = " & whichmovie)
  39.   if whichmovie = void or the movie contains whichmovie then 
  40.     set temp = the movie
  41.     set whichMovie = char 1 to (offset(".", temp)-1)  of temp
  42.     cursor 4
  43.     go whichFrame
  44.     set where = whichFrame & "*" & whichMovie
  45.     add(gRetraceList, where)
  46.   else
  47.     cursor 4
  48.     set whichmoviepath = me.getMoviePath(whichmovie) & whichMovie ---!!!!!Builds movie path
  49.     --alert whichmoviepath
  50.     if me.checkforCD(whichmoviepath &".dir") then --- change if not using .dir files!!!-- if fullinstall, finds files on HD
  51.       oldmovie = the movie
  52.       
  53.       go whichframe of movie whichmoviepath
  54.       --      alert string(the freebytes)
  55.       --      put oldmovie
  56.       unloadMovie (oldmovie)
  57.       --      put the result
  58.       updatestage
  59.       --      alert string(the freebytes)
  60.       set where = whichFrame & "*" & whichMovie
  61.       add(gRetraceList, where)
  62.       unload
  63.       updatestage
  64.       --      alert string(the freebytes)
  65.       
  66.     else
  67.       gTargetMovie = whichMovie
  68.       gTargetFrame = whichFrame
  69.       go frame ("cd" & gwhichCD) of movie (gInstallPath & "switcher")--- set path!!!
  70.       
  71.     end if 
  72.   end if
  73.   cursor 0
  74. end
  75.  
  76. on getMoviePath me, whichmovie
  77.   gwinCDLetter = me.findWinCD("cdinit.txt")--- new!!
  78.   if whichmovie = "debates" then
  79.     gwhichCD = 1
  80.   else
  81.     gwhichCD =2
  82.   end if
  83.   --if not(the runmode = "author") then --- to test projector in author modde
  84.     if the runmode = "author" then --- for release and true author mode
  85.       if the platform contains "Macintosh" then
  86.         return ginstallpath & "mesolore" & gwhichCD & ":data:"
  87.       else
  88.         return gwinCDLetter & "\data\"
  89.       end if
  90.     else
  91.       if gFullInstall and gwhichCD = 1 then
  92.         if the platform contains "Macintosh" then
  93.           return ginstallpath & "mesolore" & gwhichCD & ":data:"
  94.         else
  95.           return ginstallpath & "mesolore" & gwhichCD & "\data\"
  96.         end if
  97.       else--- new!!
  98.         if gWhichCD = 1 then --- if minimum install and cd = 1
  99.           if the platform contains "Macintosh" then
  100.             return "mesolore" & gwhichCD & ":mesolore1:data:"
  101.           else
  102.             return gwinCDLetter & "\mesolore1\data\"
  103.           end if
  104.         else
  105.           if the platform contains "Macintosh" then
  106.             return "mesolore" & gwhichCD & ":data:"
  107.           else
  108.             return gwinCDLetter & "\data\"
  109.           end if
  110.         end if--- new!! ^^^^^^^^^
  111.       end if
  112.     end if
  113. end
  114.  
  115. on checkForFullInstall me
  116.   temp = me.checkForCD(the moviepath & "full_install.txt")
  117.   return temp
  118. end
  119.  
  120. on checkForCD me,whFile
  121.   
  122.   set fio = new(XTRA "fileio")
  123.   fio.openfile(whFile,1)
  124.   if fio.status() = 0 then
  125.     put "fio true"
  126.     return TRUE
  127.   else
  128.     put "fio false"
  129.     return FALSE
  130.   end if
  131.   fio.closefile()
  132.   fio = 0
  133. end
  134.  
  135. on findWinCD me, whFile
  136.   set fio = new(XTRA "fileio")
  137.   repeat with x = 67 to 90
  138.     set drive= numtochar(x)
  139.     thisPath = string(drive & ":\" & whFile)
  140.     fio.openfile(thisPath,1)
  141.     --alert thispath
  142.     if fio.status() = 0 then
  143.       return drive & ":"
  144.       exit repeat
  145.     end if
  146.   end repeat
  147.   if x = 90 then 
  148.     alert"no disk in drive"
  149.   end if
  150.   fio.closefile()
  151.   fio = 0
  152. end
  153.  
  154.  
  155.  
  156.  
  157. on netLink me, where
  158.   
  159.   if the machinetype = 256 then
  160.     if gFullInstall then
  161.       gotoNetPage "file:\\\" &  ginstallpath & "mesolore1\data\" & where
  162.     else
  163.       
  164.       if not(me.checkforCD(gWinCDletter & "\mesolore1\data\Library\index.htm")) then --- new!!
  165.         gTargetMovie = "library"
  166.         gTargetFrame = where
  167.         if the frameLabel <> "cd1" then 
  168.           go frame "cd1" of movie (gInstallPath & "switcher")
  169.         end if
  170.       else
  171.         cursor 4
  172.         
  173.         gotoNetPage "file:\\\" & gWinCDLetter & "\mesolore1\data\" & where--- new!!
  174.         cursor 0
  175.       end if
  176.     end if
  177.   else
  178.     if gFullInstall then
  179.       temp = swapSlashes()
  180.       gotoNetPage "file:///" &  temp & "mesolore1/data/" & where
  181.     else
  182.       
  183.       if not(me.checkforCD("mesolore1:mesolore1:data:Library:index.htm")) then--- new!!
  184.         gTargetMovie = "library"
  185.         gTargetFrame = where
  186.         if the frameLabel <> "cd1" then 
  187.           go frame "cd1" of movie (gInstallPath & "switcher")
  188.         end if
  189.       else
  190.         cursor 4
  191.         gotoNetPage "file:///mesolore1/mesolore1/data/" & where--- new!!
  192.         cursor 0
  193.       end if
  194.     end if
  195.   end if
  196. end 
  197.  
  198. on swapSlashes() --- for html
  199.   set temp = ginstallpath
  200.   repeat with x = 1 to the number of chars in temp
  201.     if char x of temp = ":" then
  202.       put "/" into char x of temp
  203.     end if
  204.   end repeat
  205.   return temp
  206. end